<head runat="server">
    <title></title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>
</head>
<html>
<body>
    <div class="div-content">
        <textarea name="content" id="content" onkeyup="countCharDown(this);"></textarea>
        <span id="count-char-down" class="">135</span>
    </div>
    <script>
        function countCharDown(e) {
            var max_length = 135;
            var e = $(e);
            var n = $("#count-char-down");
            var string = $.trim(e.val());
            var length = string.length;
            var charDown = max_length - length;
            if (charDown < 10) {
                n.css('color', 'red');
            }
            else {
                n.css('color', '#999');
            }
            if (charDown < 0) {
                string = string.substring(0, max_length);
                e.val(string);
                charDown = 0;
            }
            n.html(String(charDown));
        }
    </script>
</body>
</html>
